package com.hlhj.funlike_business.presenter;

import android.content.Context;

import com.example.mymvp.mvp.BasePresenter;
import com.hlhj.funlike_business.bean.AddGoodBean;
import com.hlhj.funlike_business.bean.FoodTypeBean;
import com.hlhj.funlike_business.moudle.MyFoodTypeMoudle;
import com.hlhj.funlike_business.views.MyFoodTypeView;

import java.util.List;

public class MyFoodTypePresenter extends BasePresenter<MyFoodTypeMoudle,MyFoodTypeView> implements MyFoodTypeMoudle.getResult {
    @Override
    public void createModule() {
        module=new MyFoodTypeMoudle();
        module.setListener(this);
    }

    public void LoadDel(Context context, int id){
        module.LoadDel(context,id);
    }

    public void LoadAdd(Context context,String type_name){
        module.LoadAdd(context,type_name);
    }

    public void LoadGoodList(Context context){
        module.LoadGoodList(context);
    }
    @Override
    public void showDelResult(String msg) {
        getView().showDelResult(msg);
    }

    @Override
    public void showAddResult(AddGoodBean addGoodBean) {
        getView().showAddResult(addGoodBean);
    }

    @Override
    public void showGoodList(List<FoodTypeBean.DataBean> dataBeans) {
        getView().showGoodList(dataBeans);
    }
}
